package www.wen.com.common.lib.data.db

import kotlinx.coroutines.CoroutineScope
import www.wen.com.common.lib.data.entities.builtIn.Result

/**
 * @author WEN
 * @Description:
 * @date 2020/11/25 11:03
 */
interface AppDbHelper {


    suspend fun <T> insertCache(key: String, cacheEntity: T):Boolean

    suspend fun <T> findByKey(key: String): T?

    suspend fun <T> queryCache(key: String,
                               error: Result.Error, successBlock: (suspend (CoroutineScope, T) -> Unit),
                               errorBlock: (suspend (CoroutineScope, Result.Error) -> Unit)
    )

}